Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add macro to define a group of mutually anticommuting fermionic operators #11

Merged
merged 3 commits into from
Aug 28, 2021

Conversation

jfeist
Copy link
Owner

@jfeist jfeist commented Aug 27, 2021

Using @anticommuting_fermion_group c d, you get a group of mutually anticommuting fermionic operators, e.g., to treat itinerant and localized electrons with different operators. Note that two different fermionic operators defined with independent @fermion_ops calls are assumed to refer to different (quasi-)particle species, and thus commute.

Example usage:

julia> using QuantumAlgebra; QuantumAlgebra.auto_normal_form()
julia> @anticommuting_fermion_group c d
julia> comm(cdag(),d())
2 c†() d()

julia> d(:i)*c(:k)
-c(k) d(i)

The operators within a group are ordered by definition order, not alphabetically as normally:

julia> @anticommuting_fermion_group y x
julia> x()*y()
-y() x()

For comparison, for different @fermion_ops:

julia> @fermion_ops g;
julia> @fermion_ops h;
julia> comm(gdag(),h())
0

julia> h()*g()
g() h()

Closes #9.

@codecov
Copy link

codecov bot commented Aug 27, 2021

Codecov Report

Merging #11 (25b8446) into main (9c3ba81) will increase coverage by 1.14%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main      #11      +/-   ##
==========================================
+ Coverage   75.02%   76.16%   +1.14%     
==========================================
  Files          10       11       +1     
  Lines        1105     1179      +74     
==========================================
+ Hits          829      898      +69     
- Misses        276      281       +5     
Impacted Files Coverage Δ
src/QuantumAlgebra.jl 100.00% <ø> (ø)
src/alias.jl 100.00% <100.00%> (ø)
src/convert_to_expression.jl 84.37% <100.00%> (+0.50%) ⬆️
src/operator_defs.jl 95.97% <100.00%> (+0.27%) ⬆️
src/output.jl 90.64% <100.00%> (+0.49%) ⬆️
src/correlations.jl 67.74% <0.00%> (-1.01%) ⬇️
src/vacuum_expvals.jl 90.14% <0.00%> (-0.63%) ⬇️
... and 2 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9c3ba81...25b8446. Read the comment docs.

@jfeist jfeist merged commit 88c8469 into main Aug 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Define multiple fermion operators
1 participant